﻿using System;
using System.Collections.Generic;
using System.Text;

namespace _06继承与多态案例
{
    class MachineGun : Weapon
    {
        public MachineGun(string name, int magCa, int ammo, float rate, float attackRange) : base(name, magCa, ammo, rate, attackRange)
        {
        }

        public override void Fire()
        {
            base.Fire();
            AmmoNubInMc -= 5;
            _totalAmmoNum -= 5;
            Console.WriteLine("机关枪开火，一串子弹发射出去");
            if(_ammoNubInMc>5)
            {
                _totalAmmoNum += _ammoNubInMc;
                _ammoNubInMc = _magazineCapacity;
                _totalAmmoNum -= _magazineCapacity;
            }
            PrintWeaponStatus();
        }
    }
}
